<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>RenameFile</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">RenameFile()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>RenameFile</b></font>(OldFilename$, NewFilename$)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Rename the old file to the new file. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>OldFilename$</i></td>
<td width="90%"> 
 
The old name of the file. 

 

</td></tr>
<tr><td><i>NewFilename$</i></td>
<td> 
 
The new name of the file. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns nonzero if the operation succeeded and zero if it failed. 

 

</blockquote><p><b>备注</b></p><blockquote>



The old and new filename do not have to be in the same directory, so this function can be used 
to move a file to a different directory. This function can also be used to rename/move directories. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">RenameFile</font>("C:\test.txt", "D:\temp\test_backup.txt")   
    <b><font color="#3A3966">Debug</font></b> "Moving and renaming successful."    <font color="#3A3966">; Moving and renaming of the file was successful</font>
  <b><font color="#3A3966">Else</font></b> 
    <b><font color="#3A3966">Debug</font></b> "Moving and renaming failed."        <font color="#3A3966">; Moving and renaming failed, e.g. because of a not found source file</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="copyfile.html">CopyFile()</a>, <a href="deletefile.html">DeleteFile()</a>, <a href="../file/createfile.html">CreateFile()</a>, <a href="copydirectory.html">CopyDirectory()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=nextdirectoryentry.html>NextDirectoryEntry()</a> - <a href="index.html">FileSystem Index</a> - <a href="setcurrentdirectory.html">SetCurrentDirectory()</a> -&gt;<br><br>

</body></html>